<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=no">
	<meta name="format-detection" content="telphone=no, email=no"/>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<title>环境指数公众版</title>
	<link rel="stylesheet" type="text/css" href="assets/css/reset.css">
	<link rel="stylesheet" type="text/css" href="assets/css/iconfont/iconfont.css">
	<link rel="stylesheet" type="text/css" href="assets/css/app.css">
	<link rel="stylesheet" type="text/css" href="assets/css/public.css">
	<style>
		.pb-fx-item{
			position: relative;
		}
		.pb-fx-item i{
			font-size: 0.5rem!important;
			display: block;
		}
		.pb-fx-item span{
			display: block;
			font-size: 0.6rem!important;
		}
		.pb-fx-item i sub{
			font-size: 0.5rem!important;
		}
		.pb-fx-item i.suffix{
			font-size: 0.5rem!important;
			padding: 0;
			margin: 0;
			line-height: 100%;
		}
		.loclbtn{
			display:block;
			width:30px;
			height:30px;
			position:absolute;
			right:10px;
			bottom:10px;
			cursor: pointer;
			border:1px solid #efefef;
			background-color:#ffffff;
			line-height: 25px;
			text-align: center;
			border-radius: 20%;
			box-shadow: 1px 1px 3px #666666;
		}
		.loclbtn i{
			position: absolute;
			left: 4px;
			top: 4px;
			width: 20px;
			height: 20px;
			border: 1px solid #0075C7;
			border-radius: 50%;
			background-color: #ffffff;
			z-index: 2;
		}
		.loclbtn b{
			display: block;
			width: 60%;
			height: 60%;
			margin: 20%;
			border-radius: 50%;
			background-color: #0075C7;
		}
		.loclbtn .iv{
			width: 3px;
			height: 100%;
			background-color: #0075C7;
			position: absolute;
			left: 13px;
			top: 0;
			z-index: 1;
			border: 1px solid #ffffff;
		}
		.loclbtn .ih{
			height: 3px;
			width: 100%;
			background-color: #0075C7;
			position: absolute;
			top: 13px;
			left: 0;
			z-index: 1;
			border: 1px solid #ffffff;
		}
	</style>
	<script type="text/javascript">
		/**
   * 对Date的扩展，将 Date 转化为指定格式的String
   * 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符
   * 年(y)可以用 1-4 个占位符，毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
   * eg:
   * (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
   * (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2009-03-10 二 20:09:04
   * (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2009-03-10 周二 08:09:04
   * (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2009-03-10 星期二 08:09:04
   * (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
   */
  Date.prototype.pattern = function(fmt) {
    var o = {
      "M+": this.getMonth() + 1, //月份
      "d+": this.getDate(), //日
      "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时
      "H+": this.getHours(), //小时
      "m+": this.getMinutes(), //分
      "s+": this.getSeconds(), //秒
      "q+": Math.floor((this.getMonth() + 3) / 3), //季度
      "S": this.getMilliseconds() //毫秒
    };
    var week = {
      "0": "\u65e5",
      "1": "\u4e00",
      "2": "\u4e8c",
      "3": "\u4e09",
      "4": "\u56db",
      "5": "\u4e94",
      "6": "\u516d"
    };
    if (/(y+)/.test(fmt)) {
      fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    if (/(E+)/.test(fmt)) {
      fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "星期" : "") : "") + week[this.getDay() + ""]);
    }
    for (var k in o) {
      if (new RegExp("(" + k + ")").test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
      }
    }
    return fmt;
  }
  
	</script>
</head>
<body style="overflow-x: hidden">
	<header>
		<div class="pb-title">空气质量指数</div>
		<div class="pb-layout">
			<div class="pb-lay-bg"></div>
			<div class="clearfix" style="z-index:2">
				<div class="pb-tit-num">-</div>
				<div class="pb-tit-lv">-</div>
			</div>
			<div class="pb-tit-wuran">
				<span class="pb-wr-txt">首要污染物</span>
				<span class="pb-wr-zb">-</span>
			</div>
		</div>
		<div class="pb-weather">-</div>
		<div class="pb-tiptxt">
			<span>各类人群可正常活动</span>
			<span>极少数异常敏感人群应减少户外活动</span>
			<span>儿童、老年人及心脏病、呼吸系统病患者应减少长时间、高强度的户外锻炼</span>
			<span>儿童、老年人及心脏病、呼吸系统病患者应避免长时间、高强度的户外锻炼，一般人群适量减少户外运动</span>
			<span>儿童、老年人及心脏病、肺病患者应停留在室内，停止户外运动，一般人群减少户外运动</span>
			<span>儿童、老年人和病人应当停留在室内，避免体力消耗，一般人群应避免户外运动</span>
		</div>
	</header>
	
	<div class="pb-content">
		<div class="flex-row pb-zb-items">
			<span class="flex-row-item pb-fx-item">
				<i>PM<sub>2.5</sub></i>
				<span id='rt-aqi-pm25'>-</span>
				<i class="suffix">ug/m³</i>
			</span>
			<span class="flex-row-item pb-fx-item">
				<i>SO<sub>2</sub></i>
				<span id='rt-aqi-so2'>-</span>
				<i class="suffix">ug/m³</i>
			</span>
			<span class="flex-row-item pb-fx-item">
				<i>NO<sub>2</sub></i>
				<span id='rt-aqi-no2'>-</span>
				<i class="suffix">ug/m³</i>
			</span>
			<span class="flex-row-item pb-fx-item">
				<i>PM<sub>10</sub></i>
				<span id='rt-aqi-pm10'>-</span>
				<i class="suffix">ug/m³</i>
			</span>
			<span class="flex-row-item pb-fx-item">
				<i>CO<sub></sub></i>
				<span id='rt-aqi-co'>-</span>
				<i class="suffix">mg/m³</i>
			</span>
			<span class="flex-row-item pb-fx-item">
				<i>O<sub>3</sub></i>
				<span id='rt-aqi-o3'>-</span>
				<i class="suffix">ug/m³</i>
			</span>
		</div>
		
		<div class="pb-map-chart" style="border-bottom:2px solid #eeeeee;position: relative;">
			<div id="allmap" style="height: 10rem;"></div>
			<span style="display:none;" id="loclbtn" class="loclbtn" onclick="localToPoint()"><i><b></b></i><span class="iv"></span><span class="ih"></span></span>
		</div>
		
		<div class="pb-score-list" style="display:none;">
			<span class="pb-sc-con">
				<i class="iconfont icon-liuliangxinxishangbao pb-small"></i>
				<span class="pb-twhite">空气质量排名:</span>
				<i class="iconfont icon-gongsi"></i>
				<span class="pb-tgrey">省内第<b id='js-order-val'>-</b>名</span>
				<i class="iconfont icon-gongsi"></i>
				<span class="pb-tgrey">全国74城市第<b id='csj-order-val'>-</b>名</span>
			</span>
		</div>
		
		<!--<div class="pb-chart-legend flex-row" style="border-top:1px solid #08A321;">
			<span data-idx="0" class="active flex-row-item aqi-chart-time">每小时</span>
			<span data-idx="1" class="flex-row-item aqi-chart-time">每天</span>
		</div>-->
		<div class="order-hd">
            <div class="order-hd-title">今日空气质量及污染物趋势</div>
        </div>
		<div class="pb-tip-txt">点击下面的按钮查看指标</div>
		
		<div class="pb-zhibiao-legend flex-row">
		    <span class="active flex-row-item zb-item color-aqi">AQI<b>1</b></span>
			<span class="flex-row-item zb-item color-pm25">PM<sub>2.5</sub><b>2</b></span>
			<span class="flex-row-item zb-item color-so2">SO<sub>2</sub><b>3</b></span>
			<span class="flex-row-item zb-item color-no2">NO<sub>2</sub><b>4</b></span>
			<span class="flex-row-item zb-item color-pm10">PM<sub>10</sub><b>5</b></span>
			<span class="flex-row-item zb-item color-co">CO<b>6</b></span>
			<span class="flex-row-item zb-item color-o3">O<sub>3</sub><b>7</b></span>
		</div>
		
		<div class="pb-line-chart" id="aqi-chart"></div>
	</div>
</body>

<script src="assets/js/jquery.js"></script>
<script src="assets/js/touch.min.js"></script>
<script src="assets/js/highcharts.js"></script>
<!--<script src="assets/echart/echarts.pie.min.js"></script>-->
<!--<script src="assets/echart/echarts.min.js"></script>-->
<script src="assets/js/function_public.js"></script>

<script src="assets/echart/echarts.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=EO5oHjEfgBz7QieWfqG08jcx"></script>
<script type="text/javascript" src="http://api.map.baidu.com/getscript?v=2.0&ak=EO5oHjEfgBz7QieWfqG08jcx&services=&t=20160310104956"></script>
<!--<script type="text/javascript" src="http://api.map.baidu.com/library/Heatmap/2.0/src/Heatmap_min.js"></script>-->
<script src="assets/maps/geocoordmap.js"></script>
<!--<script src="assets/maps/mapstyle.js"></script>-->

<script>
/*请求地址全局变量*/
// var RequestUrl = '.';
var RequestUrl = 'http://58.213.141.220:8989/njhbindex';
//var RequestUrl = 'http://127.0.01:8020/njhb_new';
var tapidx=0;
var AQIChartCache={};

//自适应设备尺寸
var _my_size = getPageSize();
var baseSize,baseSize_x;
baseSize_x = _my_size[2]/320;
baseSize = _my_size[3]/480;
$(function(){
	// $(window).bind('resize load',function(){
		_my_size = getPageSize();
		baseSize_x = _my_size[2]/320;
		baseSize = _my_size[3]/480;
		//重置fontsize
		$('html').css('font-size', baseSize_x*20+'px');
		
		/*----------------start------------------*/
		//天气预报
		findWeather(RequestUrl+'/weather');
		
		//首要污染物
		getJSONData(RequestUrl+"/data?act=aqin&areacode=2000",function(data){
			if(data.Error==null){
				var aqidata=data.Data;
				aqidata.forEach(function(e,i){
					$('.pb-tit-wuran span.pb-wr-zb').html(getAQIItemByCode(e.first));
				    $('#rt-aqi-pm25').text(parseInt(e.pm25)).css({'color':parseInt(e.aqi)<150?'#7A469D':'#ffffff','background-color':num2color(parseInt(e.aqi))});
				    $('#rt-aqi-pm10').text(parseInt(e.pm10)).css({'color':parseInt(e.aqi)<150?'#7A469D':'#ffffff','background-color':num2color(parseInt(e.aqi))});
				    $('#rt-aqi-no2').text(parseInt(e.no2)).css({'color':parseInt(e.aqi)<150?'#7A469D':'#ffffff','background-color':num2color(parseInt(e.aqi))});
				    $('#rt-aqi-so2').text(parseInt(e.so2)).css({'color':parseInt(e.aqi)<150?'#7A469D':'#ffffff','background-color':num2color(parseInt(e.aqi))});
				    $('#rt-aqi-co').text(parseFloat(e.co)).css({'color':parseInt(e.aqi)<150?'#7A469D':'#ffffff','background-color':num2color(parseInt(e.aqi))});
				    $('#rt-aqi-o3').text(parseInt(e.o3)).css({'color':parseInt(e.aqi)<150?'#7A469D':'#ffffff','background-color':num2color(parseInt(e.aqi))});
					$('.pb-tit-num').text(e.aqi);
					$('header').css({'background-image':'url(./assets/img/public_top_bg'+num2imgbg(parseInt(e.aqi))+'.png)'});
					$('.pb-tit-lv').text(num2table(e.aqi).note);
					$('.pb-tiptxt span').eq(num2table(e.aqi).idx).css({'display':'inline-block'});
				});
			}else{
				console.log(data.Error);
			}
		});
		
		//排名
		get_citys_order();
		
		
		AQIChange(RequestUrl+'/data?act=aqih&areacode=2000',0);
		// AQIChange(RequestUrl+'/data?act=aqid&areacode=2000',1);
			
		touch.on('.aqi-chart-time', 'tap', function(ev){
		  tapidx=ev.target.getAttribute('data-idx');
		  $('.aqi-chart-time').removeClass('active').eq(tapidx).addClass('active');
		  //change chart
		  var cd=AQIChartCache[tapidx];
		  AQIChart(cd.time,cd.aqi,cd.pm,cd.so,cd.no,cd.pm2,cd.co,cd.o);
		});
		
		$(document).on('click','.zb-item',function(){
		    var disable=$(this).hasClass('active');
		    if(disable==true){
		        $(this).removeClass('active');
		    }else{
		        $(this).addClass('active');
		    }
		    var cd=AQIChartCache[tapidx];
		    AQIChart(cd.time,cd.aqi,cd.pm,cd.so,cd.no,cd.pm2,cd.co,cd.o);
		});
		
		/*----------------end------------------*/
	// })
})
</script>


<script>
  var host=RequestUrl;
  var myChart,__type=0;
  var AllCitys=["海门","鄂尔多斯","招远","舟山","齐齐哈尔","盐城","赤峰","青岛","乳山","金昌","泉州","莱西","日照","胶南","南通","拉萨","云浮","梅州","文登","上海","攀枝花","威海","承德","厦门","汕尾","潮州","丹东","太仓","曲靖","烟台","福州","瓦房店","即墨","抚顺","玉溪","张家口","阳泉","莱州","湖州","汕头","昆山","宁波","湛江","揭阳","荣成","连云港","葫芦岛","常熟","东莞","河源","淮安","泰州","南宁","营口","惠州","江阴","蓬莱","韶关","嘉峪关","广州","延安","太原","清远","中山","昆明","寿光","盘锦","长治","深圳","珠海","宿迁","咸阳","铜川","平度","佛山","海口","江门","章丘","肇庆","大连","临汾","吴江","石嘴山","沈阳","苏州","茂名","嘉兴","长春","胶州","银川","张家港","三门峡","锦州","南昌","柳州","三亚","自贡","吉林","阳江","泸州","西宁","宜宾","呼和浩特","成都","大同","镇江","桂林","张家界","宜兴","北海","西安","金坛","东营","牡丹江","遵义","绍兴","扬州","常州","潍坊","重庆","台州","南京","滨州","贵阳","无锡","本溪","克拉玛依","渭南","马鞍山","宝鸡","焦作","句容","北京","徐州","衡水","包头","绵阳","乌鲁木齐","枣庄","杭州","淄博","鞍山","溧阳","库尔勒","安阳","开封","济南","德阳","温州","九江","邯郸","临安","兰州","沧州","临沂","南充","天津","富阳","泰安","诸暨","郑州","哈尔滨","聊城","芜湖","唐山","平顶山","邢台","德州","济宁","荆州","宜昌","义乌","丽水","洛阳","秦皇岛","株洲","石家庄","莱芜","常德","保定","湘潭","金华","岳阳","长沙","衢州","廊坊","菏泽","合肥","武汉","大庆","淮南","滁州","香港","澳门","台北","草场门","中华门","瑞金路","玄武湖","山西路","迈皋桥","仙林大学城","奥体中心","浦口","江宁彩虹桥","高淳淳溪","六合雄州","溧水永阳"];
	var SHCitys=['北京','上海','天津','重庆','哈尔滨','长春','沈阳','呼和浩特','石家庄','乌鲁木齐','兰州','西宁','西安','银川','郑州','济南','太原','合肥','武汉','长沙','南京','成都','贵阳','昆明','南宁','拉萨','杭州','南昌','广州','福州','海口','深圳','台北','香港','澳门'];
	var JSCitys  = ['盐城','南通','扬州','泰州','镇江','宿迁','苏州','淮安','常州','连云港','无锡','南京','徐州'];
	var CSJCitys = ['上海','杭州','宁波','绍兴','湖州','嘉兴','舟山','台州','合肥','马鞍山','金华','衢州','芜湖','滁州','淮南','丽水','温州','盐城','南通','扬州','泰州','镇江','宿迁','苏州','淮安','常州','连云港','无锡','南京','徐州'];
	var NJCitys=['南京','草场门','中华门','瑞金路','玄武湖','山西路','迈皋桥','仙林大学城','奥体中心','浦口','江宁彩虹桥','高淳淳溪','六合雄州','溧水永阳'];
	var __cache__={};
	var AllAQIs={},BMapExt,map,container;
	(function () {
    require.config({
        paths: {
            echarts: './assets/echart'
        },
        packages: [
            {
                name: 'BMap',
                location: './assets/bmap',
                main: 'main'
            }
        ]
    });

    require(
    [
        'echarts',
        'BMap',
        'echarts/chart/map'
    ],
    function (echarts, BMapExtension) {
        // 初始化地图
        BMapExt = new BMapExtension($('#allmap')[0], BMap, echarts,{
            enableMapClick: false
        });
        setChartOpts();
        
        // 省内城市
        // getJSONData(host+"/map",function(data){
        //     if(data.Error==null){
        //     data.Data.forEach(function(e){
        //         AllAQIs[RMS(e.name)]=parseInt(e.aqi);
        //     });
        //     }
            // 南京监测点
            getJSONData(host+"/data?act=aqiarean",function(data){
            if(data.Error==null){
                var d=data.Data;
                for(var i in d){
					if(i==2018||i==2011) continue;
					if(d[i].name=='市区'){
						AllAQIs['南京']=d[i].aqi;
					}else{
						AllAQIs[d[i].name]=d[i].aqi;
					}
                }
            }
            // initChart(0);
            //initPoints();
			
				showCMView(12);
            });
        // });
    });
})();
function getCitys(type){
  __type=type;
	if(type<=7){
		return AllCitys
	}else{
		return [].concat(NJCitys,AllCitys)
	}
}
function getAQI(aqi){
	var num=parseInt(aqi);
	if(isNaN(num)) return null;
	return num
}
var mk=null;
function localToPoint(){
    //定位
    var geolocation = new BMap.Geolocation();
    geolocation.getCurrentPosition(function(r){
		if(this.getStatus() == BMAP_STATUS_SUCCESS){
			var ps=moveTo(r.point.lng,r.point.lat);
			r.point.lng=ps[0];
			r.point.lat=ps[1];
			if(mk!=null) map.removeOverlay(mk);
			if(ps[2]==false){
				var myIcon = new BMap.Icon("./assets/img/mr.png", new BMap.Size(36,38));
				mk = new BMap.Marker(r.point,{icon:myIcon});
				map.addOverlay(mk);
			}
			map.panTo(r.point);
		}
		else {
			console.log('failed'+this.getStatus());
		}        
	},{enableHighAccuracy: true})
}
function setChartOpts(){
        map = BMapExt.getMap();
        container = BMapExt.getEchartsContainer();
        map.centerAndZoom(new BMap.Point(118.78,32.04), 12);
		map.setMapStyle({style:'googlelite'});
		$('#loclbtn').css('display','block');
	}
    
  function showCMView(zoom){
            myChart = BMapExt.initECharts(container);
            initChart(zoom);
  }
  function initChart(type,zoom){
      var type=type!=null?type:__cache__.type;
	var citys=getCitys(type);
	__cache__.type=type;
	var data=[];
	citys.forEach(function(e){
		if(AllAQIs[e]){
			var aqi=getAQI(AllAQIs[e]);
			data.push({name:e,value:aqi
				,itemStyle:{
					normal:{
						color:num2color(aqi)
					}
				}
				,label:{
					normal:{
						textStyle:{
							color:aqi>50&&aqi<150?'#7A469D':'#ffffff'
						}
					}
				}
			});
		}
	});
	var showcitys = [];
	var option = {
      color: ['gold','aqua','lime'],
      title : {
      		show:false
      },
      tooltip : {
          trigger: 'item',
          formatter: function (v) {
			  if(v[1]==undefined) return '';
              return v[1]+' AQI: '+v[2]+' ('+num2table(v[2]).note+')';
          },
          textStyle:{
          	fontSize:10*baseSize_x
          }
      },
      legend: {
          data:['全国'],
          show:false
      },
      toolbox: {
          show : false
      },
      dataRange: {
      	  show:false,
          min : 0,
          max : 300,
          range: {
              start: 0,
              end: 100
          },
          x: 'right',
          y:'bottom',
          calculable : false,
		  color:['#00e400','#ffff00','#ff7e00','#ff0000','#99004c','#7e0023'].reverse()
        //   color: ['#8F1531', '#CE222F', '#FA3F00','#FF9E00','#EED800','#29C500']
			// color:['rgba(0,228,0,1)','rgba(255,255,0,1)','rgba(255,126,0,1)','rgba(255,0,0,1)','rgba(153,0,76,1)','rgba(126,0,35,1)'].reverse()
          ,textStyle:{
              color:'#333333'
          }
      },
      series : [
          {
              name:'全国',
              type:'map',
              mapType: 'none',
              data:[]
              ,geoCoord: geoCoordMap
			,markPoint : {
          		symbol:'circle',
              	symbolSize: 11*baseSize_x,       // 标注大小，半宽（半径）参数，当图形为方向或菱形则总宽度为symbolSize * 2
              	itemStyle: {
	                normal: {
	                  borderColor: '#fff',
	                  borderWidth: 1,
	                  label: {
	                    show: true,
	                    textStyle:{
	                    	align:'center',
	                    	baseline:'middle',
	                    	fontSize:9*baseSize_x,
	                    	color:'#ffffff'
	                    },
	                    formatter:function(v){
							return v.value
	                    }
	                  }
	                },
	                emphasis: {
	                  borderColor: '#fff',
	                  borderWidth: 1,
	                  label: {
	                    show: false
	                  }
	                }
              	},
              	data:data
          	}
          }
    //      , {
    //       	name: 'point',
    //         type: 'map',
    //         mapType: 'none',
    //         data:[],
    //       	markPoint : {
    //       		symbol:'circle',
    //           	symbolSize: 11*baseSize_x,       // 标注大小，半宽（半径）参数，当图形为方向或菱形则总宽度为symbolSize * 2
    //           	itemStyle: {
	//                 normal: {
	//                   borderColor: '#fff',
	//                   borderWidth: 2,
	//                   label: {
	//                     show: true,
	//                     textStyle:{
	//                     	align:'center',
	//                     	baseline:'middle',
	//                     	fontSize:9*baseSize_x,
	//                     	color:'#fff'
	//                     },
	//                     formatter:function(v){
	// //                  	if(zoom>5||type>0){
	// //                  		return v.name+': '+v.value
	// //                  	}
	// //                  	return '  '//+v.name
	// 						return v.value
	//                     }
	//                   }
	//                 },
	//                 emphasis: {
	//                   borderColor: '#fff',
	//                   borderWidth: 2,
	//                   label: {
	//                     show: false
	//                   }
	//                 }
    //           	},
    //           	data:data
    //       	}
    //       }
//           ,{
//             name: 'point',
//             type: 'map',
//             mapType: 'none',
//             data:[],
//             markPoint:{
//             symbolSize:0.1,
//             itemStyle:{
//                 normal:{
//                     label:{
//                         show:false,
//                         textStyle:{
//                             align:'left',
//                             baseline:'middle',
//                             fontSize:8*baseSize,
//                     		color:'#000'
//                         },
//                         formatter:function(v){
// //                          return '  '+v.name
// 							console.log(v);
// 							return v.value
//                         }
//                     }
//                 }
//             },
//             data:showcitys
//             }
//           }
	    ]
	  };
    BMapExt.setOption(option);
    myChart.refresh();
  }
//heatmapOverlay = new BMapLib.HeatmapOverlay({
//    'radius':20*baseSize_x
//  });
//function initPoints(){
//	return;
//  var points=[],data=[];
//  for(var i in AllAQIs){
//    if(geoCoordMap[i]!=undefined){
//      points.push({'name':i,'lng':geoCoordMap[i][0],'lat':geoCoordMap[i][1],'count':AllAQIs[i]});
//      // data.push([geoCoordMap[i][0],geoCoordMap[i][1],AllAQIs[i]]);
//    }
//  }
//  
//  map.addOverlay(heatmapOverlay);
//  heatmapOverlay.setDataSet({data:points,max:300});
//  heatmapOverlay.show();
//}
// getJSONData("?act=public&znmhlocation=true",function(data){});
function moveTo(longitude, latitude) {
	var out=false;
	// 在南京外面的定位  强制拉到新街口
   if (longitude < 118.48158925991368 ||
   		 longitude > 119.14076894741368 ||
		    latitude > 32.20241194404216 ||
		     latitude < 31.924552839077077) {
       longitude = 118.783941;
       latitude = 32.041631;
	   out=true;
	   alert('你的地理位置已经超出南京市范围！');
   }
   return [longitude,latitude,out]
}


function num2color(num){
		var num=parseInt(num);
		var color='rgba(0,228,0,1)';
		if(num<50){
			color='rgba(0,228,0,1)';
		}else if(50<num&&num<=100){
			color='rgba(255,255,0,1)';
		}else if(100<num&&num<=150){
			color='rgba(255,126,0,1)';
		}else if(150<num&&num<=200){
			color='rgba(255,0,0,1)';
		}else if(200<num&&num<=300){
			color='rgba(153,0,76,1)';
		}else if(num>300){
			color='rgba(126,0,35,1)';
		}
		return color
	}
</script>
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan style='display:none;' id='cnzz_stat_icon_1259663969'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s4.cnzz.com/z_stat.php%3Fid%3D1259663969' type='text/javascript'%3E%3C/script%3E"));</script>
</html>